package 华为测试;

import java.util.Scanner;

/**
 * Created by hest0 on 2017/7/6.
 */
public class 华为第二题 {

    static final String ALP = "FGRSTL" + "MNOPQ" + "WXYZU" + "AGHIJ" + "KBCDE" +
            "lmnop" + "ijkfg" + "habcd" + "eqrwx" + "yzstu" + "v";

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String s = sc.nextLine();
            String res = func(s);
            System.out.println(res);
        }
        sc.close();
    }

    private static String func(String s) {
        StringBuilder sb = new StringBuilder();
        //判断s是不是只有#
        boolean flag = s.replaceAll("[^#]+", "").length() == s.length();
        if (flag) {
            return "";
        } else {
            String s1 = s.replaceAll("#+", "#").replaceAll("\\-", "0").replaceAll("\\.", "1");//#0101#0011011
            String[] a = s1.split("#");//0101 0011011
            for (int i = 0; i < a.length; i++) {
                String numStr = a[i];//0101
                if (numStr.equals(""))//##--..
                    continue;
                int decNum = Integer.parseInt(numStr, 2);//5
                if (decNum <= 51 && decNum >= 0) {
                    String apl = String.valueOf(ALP.charAt(decNum));//G
                    sb.append(apl);
                } else {
                    return "\"" + "ERROR" + "\"";
                }
            }
        }
        return sb.toString();
    }
}
